myApp.controller('inspectionContentListCtrl',function ($scope,$rootScope,$sce,$uibModal,$log,$filter,$http,$timeout,$stateParams,$state,httpService,commonUtil) {

	$rootScope.$on('showInfo',function (event,d) {
		for(var i = 0; i < $rootScope.pageData.length; i++){
			if($rootScope.pageData[i].id == d.id){
                var formBoxData={
                    title: "查看巡检内容",
                    modalApi: "",
                    confirmFunc: "moreData()",
                    checkedAsset: $rootScope.pageData[i]
                };
                $uibModal.open({
                    templateUrl: "modal/asset_detail/asset_detail.html",
                    controller: "asset_detail",
                    size: "50",
                    resolve: {
                        formBoxData: function () {
                            return formBoxData;
                        }
                    }
                });
				break;
			}
		}
	});
    $rootScope.$on('to-list', function(event, data) {
        if(data == "moreData"){
            $scope.moreData();
		}
    });

    /*--------------*/
    $scope.maxSize = 5;
//    $scope.currentPage = 1;
//    $scope.totalItems=0;
    $scope.pageData = {
		"currentPage":1,
		"totalResult":0
	};
    
    $scope.moreData=function(){
        // $scope.showData=$scope.tempData[$scope.currentPage-1];
        console.log($scope.pageData);
       /*httpService.getRequest('assets/selectAssets',$scope.pageData).then(function(result){
           console.log(result);
           var page=result.data.data;
           $scope.pageData.totalResult = page.totalResult;
           
           $scope.showData=page.list.map(function(item,index){
        	   item.buyTime = commonUtil.substringDate(item.buyTime);
        	   return item;
           });
        });*/
    };
    $scope.moreData();

    $scope.$on('changeSearch',function(event,data){
    	var pd={};
    	pd.keyword=data.keyword;
    	$scope.pageData.pd=pd;
    	$scope.moreData();
    });
});